﻿var ScrambledEggs;
(function (ScrambledEggs) {
    (function (Modules) {
        var Hat = (function () {
            function Hat(Sign, Description) {
                this.Sign = Sign;
                this.Description = Description;
            }
            return Hat;
        })();
        Modules.Hat = Hat;        
        var HatEvent = (function () {
            function HatEvent() {
            }
            HatEvent.prototype.initialize = function (gameState, onUpdate) {
                this._onUpdate = onUpdate;
            };
            HatEvent.prototype.update = function (gameState, triggerqource) {
                var me = this;
                if(gameState.State.Phase == ScrambledEggs.GamePhase.YoungAdult && gameState.State.Hat == "") {
                    var setHat = function (hat) {
                        gameState.State.Hat = hat;
                        gameState.State.Message = "You don your hat and look upon yourself in the mirror with pride. <strong>" + gameState.State.Hat + "</strong>" , "Continue";
                        me._onUpdate();
                    };
                    var showHats = function () {
                        ScrambledEggs.Utility.General.OptionBox("The box opens. Choose your <strong>hat</strong> wisely!", {
                            Content: "Cowboy Hat: <strong>@</strong>",
                            Action: function () {
                                setHat("@");
                            }
                        }, {
                            Content: "Baseball Cap: <strong>ô</strong>",
                            Action: function () {
                                setHat("ô");
                            }
                        }, {
                            Content: "Bowler Hat: <strong>o</strong>",
                            Action: function () {
                                setHat("o");
                            }
                        }, {
                            Content: "Sombrero: <strong>ⓞ</strong>",
                            Action: function () {
                                setHat("ⓞ");
                            }
                        }, {
                            Content: "Propellor Hat: <strong>Ø</strong>",
                            Action: function () {
                                setHat("Ø");
                            }
                        }, {
                            Content: "Coonskin Cap: <strong>Ϙ</strong>",
                            Action: function () {
                                setHat("Ϙ");
                            }
                        });
                    };
                    ScrambledEggs.Utility.General.InfoBox("Your " + (gameState.State.Gender == ScrambledEggs.Gender.Male ? "father" : "mother") + " approaches", "...", function () {
                        ScrambledEggs.Utility.General.InfoBox("\"The time has come!\"", "Time for what?!", function () {
                            ScrambledEggs.Utility.General.InfoBox("\"Time to make one of the most important decisions of your life, my " + (gameState.State.Gender == ScrambledEggs.Gender.Male ? "boy.\"" : "girl.\""), "Huh...?", function () {
                                ScrambledEggs.Utility.General.YesNoBox("\"I have here a box, containing four <strong>hats</strong>.\"<br /><br />\"You may choose <strong>only one hat</strong>.\"<br /><br />\"Whichever <strong>hat</strong> you choose, will be bound to you for the rest of your life.\"<br /><br /><br /><br />Are you ready to make this decision right now?", showHats, function () {
                                    ScrambledEggs.Utility.General.InfoBox("Too bad!", "...", showHats);
                                });
                            });
                        });
                    });
                }
            };
            return HatEvent;
        })();
        Modules.HatEvent = HatEvent;        
    })(ScrambledEggs.Modules || (ScrambledEggs.Modules = {}));
    var Modules = ScrambledEggs.Modules;
})(ScrambledEggs || (ScrambledEggs = {}));
